import requests


class TestIHRMLogin:

    # 登录成功
    def test_login_success(self):
        session = requests.session()
        login_url = "http://ihrm2-test.itheima.net/api/sys/login"
        login_header = {"Content-Type": "application/json"}
        login_body = {"mobile": "13800000002", "password": "123456"}
        login_resp = session.post(url=login_url, headers=login_header, data=login_body)
        print("login_resp=", login_resp.json())
        # 断言
        assert 200 == login_resp.status_code
        # assert 10000 == login_resp.json().get("code")
        assert "操作成功！" == login_resp.json().get("message")
